Skip to content

docs: add guidance on object and flattened field types#2594

Open
andrewkroh wants to merge 1 commit intoelastic:mainfrom
andrewkroh:add-object-field-guidance
Open

docs: add guidance on object and flattened field types#2594
andrewkroh wants to merge 1 commit intoelastic:mainfrom
andrewkroh:add-object-field-guidance

Conversation

@andrewkroh
Copy link
Copy Markdown
Member

Summary

Add documentation clarifying when object and flattened field types are
acceptable in ECS, and when explicit leaf fields must be used instead.

Motivation

The entity field set introduced 5 open object containers
(entity.attributes, entity.behavior, entity.lifecycle,
entity.metrics, entity.raw) with zero defined children. This allows
integrations to independently define subfields with conflicting types and
semantics, bypassing the coordination that ECS exists to provide.

The pattern is being replicated (see #2577), and the concern was raised
during review but there is no documented policy to point to.

What this establishes

An object with no defined children should only be used for opaque,
source-specific data with a homogeneous shape (like labels). A flattened
field should be used when arbitrary keys would cause mapping explosion (like
HTTP headers). Neither is appropriate when the subfields carry semantic
meaning. In those cases, explicit leaf fields with specified types must be
defined in the schema.

The RFC template now prompts contributors to justify any use of object or
flattened without defined children.

Add documentation to schemas/README.md explaining when object and
flattened field types are acceptable in ECS schema definitions,
and when explicit leaf fields must be used instead.

Add a review checkpoint to the RFC template requiring
contributors to justify any use of object or flattened types
without defined children.
@andrewkroh andrewkroh requested a review from a team March 27, 2026 15:46
@github-actions
Copy link
Copy Markdown

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant